package cn.promonkey.blog.common.sms;

import com.github.qcloudsms.SmsSingleSender;
import com.github.qcloudsms.SmsSingleSenderResult;

import cn.promonkey.blog.common.constant.ErrorEnum;
import cn.promonkey.blog.common.exception.ApiException;
import lombok.extern.log4j.Log4j2;

import java.util.ArrayList;

/**
 * 腾讯短信服务
 * @author: yaohw
 * @create: 2020-05-18 10:38
 **/
@Log4j2
public class LogSmsCodeService extends BaseSmsCodeService{

    public LogSmsCodeService (SmsServiceProperties properties) {

    }

    /**
     * 发送短信验证码实现
     *
     * @param mobile 手机号
     * @return
     */
    @Override
    protected SendResult handleSendSmsCode(long mobile) {
        String code = createCode();
        // 默认只能发送中国大陆的短信86
        System.out.println("手机号"+mobile+"对应的验证码为："+code);
        log.info("手机号"+mobile+"对应的验证码为："+code);
        return new SendResult(true,code);

    }
}
